 <projecta charset="utf-8">

<div class="box box-primary" id="app_project_edit">
 
            <!-- form start -->
            <form role="form" id=project_edit_form>
              <div class="box-body">
              
                <div class="form-group">
                  <label for="title">项目名称</label>
                  <input type="text" name="name" v-model="project.name" class="form-control" id="name" placeholder="请输入项目名称"  required aria-required="true" >
                </div>
                 
                 <div class="form-group">
                  <label for="title">项目负责人</label>
                  	<select type="text" name="pmUserId" v-model="project.pmUserId"
						v-kselect="{url:'/pmp/service/ma/pmpCloudMember/loadCloudMemberComboboVo',vmodel:'project.pmUserId',firstEmpty:'true'}" class="form-control" id="pmUserId">
				</select>
                </div>
                
                  <div class="form-group">
                  <label for="title">项目组开发成员</label>
                  
                  <input type="text" name="devNames"   v-on:click="doSelectDev" v-model="project.devNames" class="form-control" placeholder="请选择项目组成员" readonly="readonly"  id="devNames">
                 
				</select>
                </div>

			<div class="form-group">
                  <label for="title">项目组测试成员</label>
                  
                  <input type="text" name="testNames"   v-on:click="doSelectTester" v-model="project.testNames" class="form-control" placeholder="请选择项目组成员" readonly="readonly"  id="testNames">
                 
				</select>
                </div>
                
   				 <div class="form-group">
                  <label for="title">项目简介</label>
                  <textarea class="form-control"  name="detail" v-model="project.detail"  rows="3" id="detail"></textarea>
                </div>
                
               </div>
              <!-- /.box-body -->
              <div class="box-footer">
                 <button type="button" class="btn btn-default" v-on:click="cancel">取消</button>
                 <button type="button" class="btn btn-info pull-right"  v-on:click="doCreate">提交</button>
              </div>
            </form>
</div>
<script type="text/javascript">

new Vue({
        el: '#app_project_edit',
        data:  {
    		project:{
    			name: null,
    			pmUserId: null,
    			detail: null,
    			devNames: "",
    			devIds: "",
    			testNames: "",
    			testIds: "",
    		},
    	    bus:new Vue()
     }, 
     mounted: function(){
    	 var _this=this;
     },
     methods: {
        	 doCreate: function () {
        		 var _this=this;
        	    	if($("#project_edit_form").valid()){
        	    		var url="/pmp/service/ma/pmpProject/createPmpProject";
        	    		zfesAjax.ajaxTodo(url,_this.$data.project, function(data){
        	    			alertSwal.successText(data.message);
        	    			layer.close(layer.index);
        	    		})
        	    	}
        	    },
        	    doSelectDev:  function(){
        	    	 var _this=this;
          			  var url="/views/cloudMember/cloudMember.lookback.html";
          			  zfesLayerEditDg.lookback(url,{},"人员列表",600,function(){
          				  var rows=zfesLayerEditDg.getCallBackParam();
          				  if(rows&&rows.length>0){
          					  var mids="";
          					  var mnames="";
          					rows.forEach(function(item,index){
          						mids+=item.id+",";
          						mnames+=item.user_name+",";
          					});
          					_this.$data.project.devIds = mids.substring(0, mids.lastIndexOf(','));
          					_this.$data.project.devNames = mnames.substring(0, mnames.lastIndexOf(','));
          				  }
          				  
          			  }); 
        	    },
        	    doSelectTester:  function(){
       	    	 var _this=this;
         			  var url="/views/cloudMember/cloudMember.lookback.html";
         			  zfesLayerEditDg.lookback(url,{},"人员列表",600,function(){
         				  var rows=zfesLayerEditDg.getCallBackParam();
         				  if(rows&&rows.length>0){
         					  var mids="";
         					  var mnames="";
         					rows.forEach(function(item,index){
         						mids+=item.id+",";
         						mnames+=item.user_name+",";
         					});
         					_this.$data.project.testIds = mids.substring(0, mids.lastIndexOf(','));
         					_this.$data.project.testNames = mnames.substring(0, mnames.lastIndexOf(','));
         				  }
         				  
         			  }); 
       	    },
        	    cancel: function(){
        	    	 layer.close(layer.index);
        	    	 
        	    }
    }
})

 </script>
